package com.itheima.controller;

import com.itheima.pojo.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {
    @GetMapping("/{id}")
    public User findById(@PathVariable("id") Integer id) {
        System.out.println("从数据库中获取用户数据!");
        User user = new User();
        user.setId(id);
        user.setName("模拟出来的用户名");
        return user;
    }
}
